package com.muyu.product.service.impl;

import java.util.List;

import com.muyu.common.core.utils.ObjUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import com.muyu.product.mapper.AsCategoryAttributeGroupMapper;
import com.muyu.product.domain.AsCategoryAttributeGroup;
import com.muyu.product.service.AsCategoryAttributeGroupService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;

/**
 * 品类属性组中间Service业务层处理
 *
 * @author DongZeLiang
 * @date 2024-02-27
 */
@Slf4j
@Service
public class AsCategoryAttributeGroupServiceImpl extends ServiceImpl<AsCategoryAttributeGroupMapper, AsCategoryAttributeGroup>  implements AsCategoryAttributeGroupService {

    /**
     * 查询品类属性组中间列表
     *
     * @param asCategoryAttributeGroup 品类属性组中间
     * @return 品类属性组中间
     */
    @Override
    public List<AsCategoryAttributeGroup> list(AsCategoryAttributeGroup asCategoryAttributeGroup) {
        LambdaQueryWrapper<AsCategoryAttributeGroup> queryWrapper = new LambdaQueryWrapper<>();


        if (ObjUtils.notNull(asCategoryAttributeGroup.getCategoryId())){
            queryWrapper.eq(AsCategoryAttributeGroup::getCategoryId, asCategoryAttributeGroup.getCategoryId());
        }

        if (ObjUtils.notNull(asCategoryAttributeGroup.getAttributeGroupId())){
            queryWrapper.eq(AsCategoryAttributeGroup::getAttributeGroupId, asCategoryAttributeGroup.getAttributeGroupId());
        }





        return list(queryWrapper);
    }
}
